#include "mainwindow.h"
#include "ui_mainwindow.h"
//#include "second_window.h"
#include "firstwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->label->setStyleSheet("color: red;");
    setStyleSheet("background-color: lightblue;");
    this->setStyleSheet(R"(
    QMainWindow {
            background-image: url(:/img/Picture/background.jpg);
            background-size: 100% 100%;
            background-position: center;
            background-repeat: no-repeat;
        }
    )");
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    firstWindow *f = new firstWindow; // 使用指针和 new 关键字来保持窗口在堆上存活
    // f->setWindowFlags(f->windowFlags() & ~Qt::WindowMaximizeButtonHint);
    // f->setFixedSize(800, 600);
    f->show();
    // f->setStyleSheet(R"(
    // QMainWindow {
    //         background-image: url(:/img/Picture/background.jpg);
    //         background-size: 100% 100%;
    //         background-position: center;
    //         background-repeat: no-repeat;
    //     }
    // )");

    this->close(); // 关闭主窗口
}

void MainWindow::on_pushButton_3_clicked()
{
   // second_window *s = new second_window; // 使用指针和 new 关键字来保持窗口在堆上存活


    // s->setWindowFlags(s->windowFlags() & ~Qt::WindowMaximizeButtonHint);
    // s->setFixedSize(800, 600);

    // s->setStyleSheet(R"(
    // QMainWindow {
    //         background-image: url(:/img/Picture/background.jpg);
    //         background-size: 100% 100%;
    //         background-position: center;
    //         background-repeat: no-repeat;
    //     }
    // )");

   // s->show();

    this->close(); // 关闭主窗口
}

